package com.lollipop.chain.advancedchain;


/**
 * @Author: J.K
 * @Date: 2021-08-31 13:47
 * @Description: 双向过滤器链
 */
public class ChainTest {
    public static void main(String[] args) {
        // 待处理消息
        String msg = "大病初愈:),久别重逢，失而复得，虚惊一场，不期而遇，如约而至，来日可期";
        Request request = new Request();
        request.setRequestStr(msg);
        Response response = new Response();
        response.setResponseStr("response");

        FilterChain fc = new FilterChain();
        fc.addFilter(new HtmlFilter()).addFilter(new FaceFilter());

        fc.doFilter(request, response, fc);
        System.out.println(request.getRequestStr());
        System.out.println(response.getResponseStr());
    }
}
